package com.qfedu.meidijiaju.controller;

import com.qfedu.meidijiaju.entity.Kfwt;
import com.qfedu.meidijiaju.entity.ResponseData;
import com.qfedu.meidijiaju.service.KfwtService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Api(tags = "自动回复客服模块接口")
@RestController
public class KfwtController {
    @Autowired
    private KfwtService kfwtService;

    @ApiOperation("查询问题")
    @RequestMapping(value = "/Kfwt/queryAnswerByName",method = RequestMethod.GET)
    public ResponseData<List<Kfwt>> queryAnswerByName(String name) {
        ResponseData <List<Kfwt>> responseData = new ResponseData<>();
        List<Kfwt> result = kfwtService.queryAnswerByName(name);

        if (result != null) {
            responseData.setCode(0);
            responseData.setData(result);
        }
        return responseData;
    }
}
